package org.dromara.system.controller.xiaofu;


import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.query.XfNewsQuery;
import org.dromara.system.domain.vo.XfNewsVo;
import org.dromara.system.service.IXfNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/xiaofu/news")
public class XfNewsController extends BaseController {

    @Autowired
    private IXfNewsService xfNewsService;

    @GetMapping("/list")
    public TableDataInfo<XfNewsVo> list(XfNewsQuery news){
        return xfNewsService.selectPageXfNewsList(news);
    }

    @GetMapping("/{newsId}")
    public R<XfNewsVo> getDetail(@PathVariable Long newsId){
        XfNewsVo xfNewsVo=xfNewsService.selectXfNewsById(newsId);
        return R.ok(xfNewsVo);
    }

}
